{% for k, v in content.items %}
<h3>{{ k }}</h3><pre>{{ v|linebreaks }}</pre>

{% endfor %}
<script>
    var  wsServer = 'ws://localhost:8888/websocket';
     var  websocket = new WebSocket(wsServer);
     websocket.onopen = function (evt) { onOpen(evt) };
     websocket.onclose = function (evt) { onClose(evt) };
     websocket.onmessage = function (evt) { onMessage(evt) };
     websocket.onerror = function (evt) { onError(evt) };
     function onOpen(evt) {
     console.log("Connected to WebSocket server.");
     }
     function onClose(evt) {
     console.log("Disconnected");
     }
     function onMessage(evt) {
     console.log('Retrieved data from server: ' + evt.data);
     }
     function onError(evt) {
     console.log('Error occured: ' + evt.data);
     }
</script>